package com.yiyuan.app.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.guaike.core.entity.enums.EnableStatusEnum;
import com.guaike.core.mybatis.plugins.BaseDAO;
import com.yiyuan.app.entity.po.GConfRoomPO;
import com.yiyuan.app.entity.result.BaseRoomVO;
import com.yiyuan.app.mapper.GConfRoomExtMapper;
import com.yiyuan.app.mapper.GConfRoomMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@AllArgsConstructor
public class GConfRoomDAO extends BaseDAO<GConfRoomMapper, GConfRoomPO> {

    private final GConfRoomExtMapper gConfRoomExtMapper;

    public List<BaseRoomVO> findPushCoinsList(Integer multipleType) {
        return gConfRoomExtMapper.findPushCoinsList(multipleType);
    }

    public List<GConfRoomPO> findRoomList(Integer roomType, Integer multipleType) {
        LambdaQueryWrapper<GConfRoomPO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(GConfRoomPO::getRoomType, roomType);
        queryWrapper.eq(GConfRoomPO::getMultipleType, multipleType);
        queryWrapper.eq(GConfRoomPO::getStatus, EnableStatusEnum.ENABLE.getCode());
        queryWrapper.orderByAsc(GConfRoomPO::getSortIndex);
        return getBaseMapper().selectList(queryWrapper);
    }

    public List<BaseRoomVO> findPushCoinsListFreeTopping(Integer multipleType) {
        return gConfRoomExtMapper.findPushCoinsListFreeTopping(multipleType);
    }

    public List<BaseRoomVO> findArcadeMachineList(Integer multipleType, Integer roomType) {
        return gConfRoomExtMapper.findArcadeMachineList(multipleType, roomType);
    }

    public List<BaseRoomVO> findArcadeMachineListFreeTopping(Integer multipleType, Integer roomType) {
        return gConfRoomExtMapper.findArcadeMachineListFreeTopping(multipleType, roomType);
    }
}
